import { createApp } from 'vue'
import customPlugin from '@/plugins/custom'
import pinia, { useMenuStore, useUserStore } from '@/plugins/store'
import router from '@/plugins/router'
import WujieVue from '@/plugins/wujie'
import ElementPlus from '@/plugins/element-plus'


import '@/assets/iconfont/iconfont.css'
import '@/assets/styles/index.scss'

import App from './App.vue'

const app = createApp(App)

app
  .use(ElementPlus)
  .use(customPlugin)
  .use(WujieVue)
  .use(pinia)
  .use(router)
  .mount('#app')

;(async () => {
  const menus = useMenuStore()
  const user = useUserStore()
  await menus.init()
  await user.getUser()
  router.replace(router.currentRoute.value.fullPath)
})()

